package com.example.springbootshiro.controller.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Author: lex
 * @Date: 2018/11/15
 */
@EnableTransactionManagement
@Configuration
@MapperScan("com.example.springbootshiro.mapper")
public class MybatisPlusConfig {

    //物理分页设置,如果不设置默认为mybatisRowBounds 内存分页
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

    //开启逻辑删除,对字段进行@TableLogic 注解,会进行逻辑删除,而不是硬删除 但是不能进行对该字段进行更新操作
    //@Bean
    //public ISqlInjector sqlInjector() {
    //    return new LogicSqlInjector();
    //}
}
